#include "qsoftplugin.h"

#include "qmodbusdrive.h"
#include "qtcpdrive.h"

#include <qplugin.h>

QSoftDrivePlugin::QSoftDrivePlugin()
{
}

QAbstractDrive * QSoftDrivePlugin::createDrive(const QString &name)
{
    QAbstractDrive *ret=NULL;
    if(name=="Modbus")
    {
        ret=new QModbusDrive;
    }
    else if(name=="TCP_Modbus")
    {
        return new QTcpDrive;
    }
    return ret;
}

QStringList QSoftDrivePlugin::keys()
{
    QStringList ret;

    ret<<"Modbus"<<"TCP_Modbus";
    return ret;
}

Q_EXPORT_PLUGIN2(QSoftDrivePlugin, QSoftDrivePlugin)
